import App from './App'
import store from "./store"
import customTabBar from '@/custom-tab-bar';

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
console.log(12)
const app = new Vue({
    ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
console.log(56)
export function createApp() {
  const app = createSSRApp(App)
  app.component('customTabBar', customTabBar)
  app.use(store)
  setGlobalProperty(app)
  return {
    app
  }
}
// #endif
import storage from './utils/storage'
function setGlobalProperty(app) {
  let systemInfo = uni.getSystemInfoSync()
  console.log(systemInfo)
  let menu = uni.getMenuButtonBoundingClientRect()
  let menuHeight = menu.height //胶囊高度
  let menuTop = menu.top //胶囊与顶部的距离
  //导航栏高度= （胶囊顶部距离-状态栏高度） x 2 + 胶囊的高度
  let navigatorHeight = (menu.top - systemInfo.statusBarHeight) * 2 + menu.height 
  //总高度 = 状态栏的高度 + 导航栏高度	
  let totalHeight = systemInfo.statusBarHeight + navigatorHeight 
  app.config.globalProperties.StatusBar = systemInfo.statusBarHeight;
  app.config.globalProperties.navigatorHeight = navigatorHeight;
  app.config.globalProperties.totalHeight = totalHeight;
  app.config.globalProperties.menuHeight = menuHeight;
  app.config.globalProperties.$storage = storage
  app.config.globalProperties.platform  = systemInfo.platform 

}